import request from '@/utils/request'

// 获取收入分类列表
export function getIncomeLedger() {
  return request({
    url: '/bookkeeping/incomeExpenses/getIncomeLedger?id=0',
    method: 'get'
  })
}

// 获取支出分类列表
export function getExpensesLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/getExpensesLedger?id=0',
    method: 'get'
  })
}

// 添加收入分类
export function addIncomeLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/addIncomeLedger',
    method: 'post',
    data: data
  })
}
// 添加支出分类
export function addExpensesLedger(data) {
  return request({
    url: 'bookkeeping/incomeExpenses/addExpensesLedger',
    method: 'post',
    data: data
  })
}
// 删除收入分类
export function deleteIncomeLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/deleteIncomeLedger',
    method: 'post',
    data: data
  })
}

// 删除支出分类
export function deleteExpensesLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/deleteExpensesLedger',
    method: 'post',
    data: data
  })
}
// 获取收入列表
export function getRevenueRecordByLedgeList(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/listIncomeRecordByLedger',
    method: 'post',
    data: data
  })
}

// 获取支出列表
export function getExpensesRecordByLedgeList(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/listIncomeRecordByLedger',
    method: 'post',
    data: data
  })
}

// 获取资产列表
export function getQueryAssets(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/queryAssets',
    method: 'post',
    data: data
  })
}

// 新增收入
export function incomeRecord(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/addIncomeRecord',
    method: 'post',
    data: data
  })
}
// 新增支出
export function incomeExpenses(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/addExpensesRecord',
    method: 'post',
    data: data
  })
}
// 查询某一收入分类的收入记录
export function getWebListIncomeRecordByLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/webListIncomeRecordByLedger',
    method: 'post',
    data: data
  })
}
// 查询某一支出分类的收入记录
export function getWebListExpensesRecordByLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/webListExpensesRecordByLedger',
    method: 'post',
    data: data
  })
}
// 获取收入分类图表数据
export function getCollectIncomeRecordByLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/collectIncomeRecordByLedger',
    method: 'post',
    data: data
  })
}
// 获取支出分类图标数据
export function grtCollectExpensesRecordByLedger(data) {
  return request({
    url: '/bookkeeping/incomeExpenses/collectExpensesRecordByLedger',
    method: 'post',
    data: data
  })
}
// 获取附件图片
export function getImgs(id) {
  return request({
    url: '/bookkeeping/base/fileUrl?id='+id,
    method: 'get',
  })
}
